import request from "@/api/request";

// 获取新闻类型列表数据
export function getNewsListApi(params:object) {
    return request({
        url: 'news',
        method: 'get',
        params
    })
}

// 新增新闻
export function addNewsApi(data:object) {
    return request({
        url: 'news',
        method: 'post',
        data
    })
}
// 根据ID获取新闻信息
export function getNewsApi(id:number) {
    return request({
        url: `news/${id}`,
        method: 'get'
    })
}
// 更新新闻信息
export function editNewsApi(data:object) {
    return request({
        url: 'news',
        method: 'put',
        data
    })
}
// 删除新闻
export function delNewsApi(id: number) {
    return request({
        url: `news/${id}`,
        method: 'delete'
    })
}
